<?php
// $Id$
/**
 * This file contains {@link EventType} which is part of the PHP Content 
 * Repository (phpCR), a derivative of the Java Content Repository JSR-170,  
 * and is licensed under the Apache License, Version 2.0.
 *
 * This file is based on the code created for
 * {@link http://www.jcp.org/en/jsr/detail?id=170 JSR-170}
 *
 * @author Travis Swicegood <travis@domain51.net>
 * @copyright PHP Code Copyright &copy; 2004-2005, Domain51, United States
 * @copyright Original Java and Documentation 
 *  Copyright &copy; 2002-2004, Day Management AG, Switerland
 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, 
 *      Version 2.0
 * @package phpContentRepository
 * @subpackage Level2
 */

/**
 * Load the {@link phpCR} library file(s)
 */ 
require_once(dirname(__FILE__) . '/../phpCR.library.php');
phpCR::loadInterface('Event', '/event');


/**
 * The event types used by the {@link ObservationManager}.
 *
 * Level 2 only
 *
 * This interface defines the following event types:
 * <ul>
 *    <li>{@link EventType::ITEM_ADDED}</li>
 *    <li>{@link EventType::ITEM_CHANGED}</li>
 *    <li>{@link EventType::ITEM_REMOVED}</li>
 *    <li>{@link EventType::ITEM_VERSIONED}</li>
 *    <li>{@link EventType::ITEM_RESTORED}</li>
 *    <li>{@link EventType::LABEL_ADDED}</li>
 *    <li>{@link EventType::LABEL_REMOVED}</li>
 *    <li>{@link EventType::ITEM_LOCKED}</li>
 *    <li>{@link EventType::ITEM_UNLOCKED}</li>
 *    <li>{@link EventType::LOCK_EXPIRED}</li>
 * </ul>
 *
 * The event types defined by the phpCR/JCR standard. Each constant is a
 * power of 2 (i.e. sets of event types can be encoded as a bitmask
 * in a long value).
 *
 * @author PHP - Travis Swicegood <travis@domain51.net>
 * @copyright Copyright &copy; 2004-2005, Domain51
 * @package phpContentRepository
 * @subpackage Level2
 */
interface EventType 
{
    const ITEM_ADDED = 1;
    const ITEM_CHANGED = 2;
    const ITEM_REMOVED = 4;
    const ITEM_VERSIONED = 8;
    const ITEM_RESTORED = 16;
    const LABEL_ADDED = 32;
    const LABEL_REMOVED = 64;
    const ITEM_LOCKED = 128;
    const ITEM_UNLOCKED = 256;
    const LOCK_EXPIRED = 512;
    
    
   /**
    * Returns the numerical constant identifying this event type. 
    *
    * This value is always a power of 2 ((i.e. sets of event types can be
    * encoded as a bitmask in a integer value).
    *
    * @see ObservationManager
    * @return int 
    */
    public function getValue();
    
    
   /**
    * Returns the descriptive name of this event type.
    *
    * @see ObservationManager
    * @return string
    */
    public function getName();
}
